<?php 
require_once('includes/db.php');
unset($_POST['cpassword'] ,$_POST['captcha']);
 $_POST['status'] = 0;
 $_POST['added_date'] = date('Y-m-d H:i:s');
pr($_POST);

//pr($_FILES);

$data = upload($_FILES);
pr($data);

if($data['flag'] == 1) {
  $_POST['avatar'] = $data['fileName'];
  ////////   THUMBNAIL /////////////
  ini_set('memory_limit', '-1');
// include image processing code
require_once('thumb/image.class.php');

$img = new Zubrag_image;
$img->max_x        = 80;
$img->max_y        = 60;
$img->GenerateThumbFile("uploads/$data[fileName]",
                         "uploads/thumbs_80_60/$data[fileName]");//700/50


$img = new Zubrag_image;
$img->max_x        = 120;
$img->max_y        = 90;
$img->GenerateThumbFile("uploads/$data[fileName]",
                         "uploads/thumbs_120_90/$data[fileName]");//700/50

$img = new Zubrag_image;
$img->max_x        = 200;
$img->max_y        = 150;
$img->GenerateThumbFile("uploads/$data[fileName]",
                         "uploads/thumbs_200_150/$data[fileName]");//700/50

  
  //////////////////////////////////// 
  $id = insert('users',$_POST);
  //echo "Record Inserted on ID $id";
//  header('location:all_users.php');
  exit;
}